package cn.com.lms.business.questionnaire.persistence.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * @Author: 16266
 * @DateTime: 2020/3/20 15:03
 * @Description: 问卷题目实体
 */
@Entity
@Getter
@Setter
@ToString
@Table(name = "bnz_questionnaire_sub", schema = "bnzj")
public class QuestionnaireSub implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Schema(name ="主键Id")
    protected Long id;

    @Schema(description="问卷题目")
    private String questionnaireTop;

    @Schema(description = "问卷题型")
    private Byte questionnaireType;

    @Schema(description = "问卷信息表Id")
    private Long questionnaireInfoId;

    @Schema(description = "问卷题目选项")
    @OneToMany(targetEntity = QuestionnaireSubOpt.class,cascade= CascadeType.ALL,fetch= FetchType.LAZY)
    @JoinColumn(name = "questionnaireSubId",referencedColumnName = "id")
    private List<QuestionnaireSubOpt> questionnaireSubOptList;

}
